﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true"
    CodeFile="NewInvoice.aspx.cs" Inherits="Documents_Invoices_NewInvoice" Title="Invoices" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="ctnMain" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table>
        <tr>
            <td>
                Избери език:
            </td>
            <td>
                <asp:DropDownList ID="ddLanguage" runat="server" AutoPostBack="true">
                    <asp:ListItem Value="1" Text="Български език"></asp:ListItem>
                    <asp:ListItem Value="2" Text="Английски език"></asp:ListItem>
                </asp:DropDownList>
            </td>
            <td>
            </td>
            <td>
            </td>
            <td>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td>
                Избери клиент:
            </td>
            <td>
                <asp:DropDownList ID="ddClient" runat="server" DataSourceID="sdsCustomerName" DataTextField="Name"
                    DataValueField="CustomerID">
                </asp:DropDownList>
            </td>
            <td>
            </td>
            <td>
            </td>
            <td>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td>
                Избери продукт:
            </td>
            <td>
                <asp:DropDownList ID="ddProductsBG" runat="server" DataSourceID="sdsProductsBG" DataTextField="NameBG"
                    DataValueField="FinalProductID">
                </asp:DropDownList>
                <asp:DropDownList ID="ddProductsEN" runat="server" DataSourceID="sdsProductsEN" DataTextField="NameBG"
                    DataValueField="FinalProductID">
                </asp:DropDownList>
            </td>
            <td>
                Количество:
                <asp:TextBox ID="txtQuantity" runat="server" Width="25px" />
                <asp:RangeValidator ID="rvQty" runat="server" ControlToValidate="txtQuantity" Type="Integer" MinimumValue="1" MaximumValue="50000" />
                <asp:RequiredFieldValidator ID="rfvQty" runat="server" ControlToValidate="txtQuantity" />
            </td>
            <td>
                Цена:
            </td>
            <td>
                <asp:DropDownList ID="ddPrices" runat="server">
                </asp:DropDownList>
            </td>
            <td>
                <asp:Button ID="btnAddProduct" runat="server" Text="Добави продукт" CausesValidation="true" />
            </td>
        </tr>
        <tr>
            <td colspan="6">
                тук ще е гридвюто с добавените продукти до момента
            </td>
        </tr>
        <tr>
            <td colspan="6" align="right">
                <asp:Button ID="btnGenerateInvoice" runat="server" Text="Преглед на фактура" OnClick="btnGenerateInvoice_Click" />
            </td>
        </tr>
    </table>
    <asp:SqlDataSource ID="sdsCustomerName" runat="server" ConnectionString="<%$ ConnectionStrings:KonturConnectionString %>"
        SelectCommand="usp_CustomersGetNames" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsProductsBG" runat="server" ConnectionString="<%$ ConnectionStrings:KonturConnectionString %>"
        SelectCommand="usp_FinalProductsGetBG" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsProductsEN" runat="server" ConnectionString="<%$ ConnectionStrings:KonturConnectionString %>"
        SelectCommand="usp_FinalProductsGetEN" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
</asp:Content>
